package com.maben.task;

import com.maben.aspect.Traceable;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j(topic = "m.TestTask")
public class TestTask {
    /**
     * 测试定时任务:
     *  看定时任务中是否有【traceId】
     */
    @Scheduled(fixedDelay = 1000*60)
    @Traceable
    public void test001(){
        try {
            int i=1/0;
        }catch (Exception e){
            log.error("定时任务【test001】报错:{}", ExceptionUtils.getStackTrace(e));
        }
    }
}
